#pragma once
#ifndef __EVENT__INCLUDED__HH__
#define __EVENT__INCLUDED__HH__

#include <string>
#include <LitPrerequisites.h>
#include <LitTokeniser.h>
#include <LitString.h>
#include <LitNamed.hpp>

namespace Lit
{
	enum EventCode
	{
		EC_RUNTIME_ERROR,
		EC_ENGINE_INITIALISED,
		EC_ENGINE_SHUTDOWN
	};
	
	class LIT_API Consumable
	{
	protected:
		bool mConsumed;
	public:
		Consumable():mConsumed(false){}
		Consumable( const Consumable& rk ){ mConsumed=rk.mConsumed; }
		virtual ~Consumable(){}

		void consume() { mConsumed = true; }
		bool isConsumed() const{ return mConsumed; }

		Consumable& operator=( const Consumable &rk ){ mConsumed = rk.mConsumed; return *this; }
	};
	class LIT_API Event : public Consumable
	{
	public:
		Event( const EventCode cod, const Tokeniser& toks ): Code(cod), Tokens( toks ){}
		Event( const Event &rk ) : Consumable( rk ), Tokens(rk.Tokens), Code(rk.Code){}
		~Event(){}

		Event& operator=( const Event &rk ){ Tokens=rk.Tokens; Code=rk.Code; mConsumed = rk.mConsumed; return *this; }

		EventCode	Code;
		Tokeniser	Tokens;
	};

	typedef RefPtr<Event>			EventPtr;
};

#endif